Clear

SetDirectory["C:\\drorbn\\AcademicPensieve\\Talks\\Geneva-2408"];
DeleteFile/@{"IType1.tex","More.tex"};

Run

SetDirectory["C:\\drorbn\\AcademicPensieve\\Talks\\Geneva-2408"];
$PageWidth=4.2;
nb2tex["IType", "IType1", PDFFolder->"Snips/IType", PDFWidth->$PageWidth];
nb2tex["More", "More", PDFFolder->"Snips/More", PDFWidth->$PageWidth];
nb2tex["Rank2", "Rank2", PDFFolder->"Snips/Rank2", PDFWidth->$PageWidth];
(*nb2tex["FormalGaussianIntegration", "FormalGaussianIntegration", PDFFolder->"Snips/FormalGaussianIntegration", PDFWidth->$PageWidth];*)
nb2tex["theta", "theta", PDFFolder->"Snips/theta", PDFWidth->$PageWidth];
Run@"\"C:\\Users\\drorb\\AppData\\Local\\Programs\\MiKTeX\\miktex\\bin\\x64\\pdflatex.exe\" IType.tex";
Run@"\"C:\\Users\\drorb\\AppData\\Local\\Programs\\MiKTeX\\miktex\\bin\\x64\\pdflatex.exe\" IType.tex"

nb2tex

As in http://drorbn.net/AcademicPensieve/Projects/nb2tex/.

SetOptions[$FrontEndSession,PrintingStyleEnvironment->"Working"];
nb2tex[nb_String,opts___Rule]:=nb2tex[nb,nb,opts];

nb2tex[nb_String,tex_String, opts___Rule]:=Module[
{notebook,PDFCounter=0,type,tag,pdfname,cells,cell,c,cl,texfiles={},TeXOut,
PDFFolder=PDFFolder/. {opts}/.PDFFolder->nb
},
nb2tex$TeXFileName=tex<>".tex";
nb2tex$PDFWidth = PDFWidth /. {opts} /. PDFWidth->6.5;
TeXOut[s_String]:=(texfiles=texfiles⋃{nb2tex$TeXFileName};
WriteString[nb2tex$TeXFileName,s]);
notebook=NotebookGet[NotebookOpen@FileNameJoin[{Directory[],nb<>".nb"}]];
If[FileType[PDFFolder]===None, CreateDirectory[PDFFolder]];
DeleteFile/@FileNames["*.pdf",PDFFolder];
cells=Cases[notebook,c_Cell /; Length[c]≥2,∞];
Do[
type=cell[[2]];
tag=CellTags /. Cases[cell,_Rule] /. CellTags->"";
Which[
type=="Text"∧tag=="tex", TeXOut[
StringReplace[cell[[1]],{"’"->"'", "”"->"\""}]<>"\n\n"],
StringMatchQ[tag,"pdf"~~___], (
pdfname=PDFFolder<>"/"<>ToString[++PDFCounter]<>".pdf";
Export[pdfname, Join[cell, Cell[PageWidth -> 80nb2tex$PDFWidth/0.75]]];
cl="c:\\drorbn\\bin\\cpdf.exe -scale-page \"0.75 0.75\" "<>pdfname<>" -o "<>pdfname;
Close@OpenRead["!"<>cl];
TeXOut[StringReplace[
"\\noindent\\nbpdfXXXType{pdfname}\n\n",
{"XXX"->StringDrop[tag,3], "Type"->type, "pdfname"->pdfname}
]]
),
type=="Input"∧tag=="exec", ToExpression[cell[[1]]],
True, Null
],
{cell,cells}
];
Close/@texfiles;
]